Abstract : A measurement of the underlying event (UE) activity in proton-proton collisions at a centre-of-mass energy of 7 TeV is performed using Drell--Yan events in a data sample corresponding to an integrated luminosity of 2.2 inverse femtobarns, collected by the CMS experiment at the LHC. The activity measured in the muonic final state (q q-bar to opposite sign muons) is corrected to the particle level and compared with the predictions of various Monte Carlo generators and hadronization models. The dependence of the UE activity on the dimuon invariant mass is well described by PYTHIA and HERWIG++ tunes derived from the leading jet/track approach, illustrating the universality of the UE activity. The UE activity is observed to be independent of the dimuon invariant mass in the region above 40 GeV, while a slow increase is observed with increasing transverse momentum of the dimuon system. The dependence of the UE activity on the transverse momentum of the dimuon system is accurately described by MADGRAPH, which simulates multiple hard emissions.