Prompt and non-prompt J/psi production in pp collisions at sqrt(s) = 7 TeV