Measurements of differential cross sections for J/ψ production in p + Pb collisions at (√SNN at the CERN Large Hadron Collider with the ATLAS detector are presented. The data set used corresponds to an integrated luminosity of 28.1 nb−1. The J/ψ mesons are reconstructed in the dimuon decay channel over the transverse momentum range 8 < pT < 30 GeV and over the center-of-mass rapidity range −2.87 < y∗ < 1.94. Prompt J/ψ are separated from J/ψ resulting from b-hadron decays through an analysis of the distance between the J/ψ decay vertex and the event primary vertex. The differential cross section for production of nonprompt J/ψ is compared to a FONLL calculation that does not include nuclear effects. Forward-backward production ratios are presented and compared to theoretical predictions. These results complement previously published results by covering a region of higher transverse momentum and more central rapidity. They thus constrain the kinematic dependence of nuclear modifications of charmonium and b-quark production in p + Pb collisions.