The communications regulator called the pitch a year ago and began the process with a lengthy list of agencies before shortlisting Universal and MediaCom in September.
Ofcom, which has previously used Media Campaign as its media agency, will ask Universal to plan and buy media around consumer information campaigns on subjects including mobile roaming, digital radio and digital TV.
The agency will also provide consultancy on trends in the advertising market, and the brief includes the buying of recruitment ad space on behalf of Ofcom.
The regulator spent more than £1 million on media in the past year and this spend is expected to increase.
Andy Jones, the chief executive of Universal McCann, said: "For a media agency this has to be one of the most satisfying of appointments."