Measurement of prompt D0, D+, D*+, and DS+ production in p–Pb collisions at √sNN = 5.02 TeV