Production of J/ψ and υ mesons in pp collisions at √s = 8 TeV