Prompt and nonprompt J/ψ production and nuclear modification in pPb collisions at √sNN=8.16 TeV