Apple, seeking to bolster its position in the hotly contested online music sector, said Wednesday it was buying Beats Music and Beats Electronics in a much-hyped deal worth $3 billion. The move is expected to help the US tech giant, a pioneer in digital music with its wildly popular iTunes platform, ramp up its efforts to counter the successful models of streaming services like Pandora, Spotify and others. The deal for the maker of high-end audio equipment and the subscription streaming music service is Apples largest acquisition ever. It calls for Beats co-founders Dr. Dre, a Grammy-winning hip-hop pioneer, and Jimmy Iovine, a veteran music executive, to join the California company.