The production of J/psi mesons in proton-proton collisions at root s = 7 TeV is studied with the LHCb detector at the LHC. The differential cross-section for prompt J/psi production is measured as a function of the J/psi transverse momentum p(T) and rapidity y in the fiducial region p(T) is an element of [0; 14] GeV/c and y is an element of [2.0; 4.5]. The differential cross-section and fraction of J/psi from b-hadron decays are also measured in the same p(T) and y ranges. The analysis is based on a data sample corresponding to an integrated luminosity of 5.2 pb(-1). The measured cross-sections integrated over the fiducial region are 10.52 +/- 0.04 +/- 1.40(-2.20)(+1.64) mu b for prompt J/psi production and 1.14 +/- 0.01 +/- 0.16 mu b for J/psi from b-hadron decays, where the first uncertainty is statistical and the second systematic. The prompt J/psi production cross-section is obtained assuming no J/psi polarisation and the third error indicates the acceptance uncertainty due to this assumption.