Apple confirmed its long-rumored acquisition of Beats Music and Beats Electronics, saying it will pay $3 billion for the companies.