Charm production at the LHC in pp collisions at sqrt(s)=7 TeV is studied with the LHCb detector. The decays D0 -> K- pi+, D+ -> K- pi+ pi+, D*+ -> D0(K- pi+) pi+, D_s+ -> phi(K- K+) pi+, Lambda_c+ -> p K- pi+, and their charge conjugates are analysed in a data set corresponding to an integrated luminosity of 15 nb^{-1}. Differential cross-sections dsigma/dp_T are measured for prompt production of the five charmed hadron species in bins of transverse momentum and rapidity in the region 0 < p_T < 8 GeV/c and 2.0 < y < 4.5. Theoretical predictions are compared to the measured differential cross-sections. The integrated cross-sections of the charm hadrons are computed in the above p_T-y range, and their ratios are reported. A combination of the five integrated cross-section measurements gives sigma(cbar{c})_{p_T < 8 GeV/c, 2.0 < y < 4.5} = 1419 +/- 12 (stat) +/- 116 (syst) +/- 65 (frag) microbarn, where the uncertainties are statistical, systematic, and due to the fragmentation functions.