Measurement of $J/\psi$, $\psi'$, $\chi_{c1}$ and $\chi_{c2}$ production using a data sample corresponding to an integrated luminosity of 20.3 fb$^{-1}$ collected with the BABAR detector at the SLAC PEP-II electron-positron storage ring operating at a centre-of-mass energy near 10.58 GeV.