Measurement of differential J/psi production cross sections and forward-backward ratios in p plus Pb collisions with the ATLAS detector