Measurement of long-range pseudorapidity correlations and azimuthal harmonics insNN=5.02 TeV proton-lead collisions with the ATLAS detector