Dre and Jimmy Iovine have sold a 51 percent share of their company, Beats Electronics, which makes the Beats by Dre headphones, to HTC, a smartphone manufacturer, for $309 million.