The initial deal, covering 33 sites such as MTV.com, could be expanded to cover 140 Viacom sites globally.
Viacom held a competitive pitch for the contract, which will run for three years. It previously used a range of search and ad services from providers that included Google, against which Viacom is pursuing a $1 billion lawsuit.
Advertising on Viacom sites will be powered by the new Yahoo! search marketing system, known by the project name Panama. The two companies claim that the deal will provide for more relevant sponsored search results and better quality ads.
Judy McGrath, the chairman and chief executive of MTV Networks, said: "Our strategy is to provide our audiences with the most immersive entertainment experience possible, and this deal with Yahoo! increases the monetisation of our growing online portfolio."