Measurement of the inelastic cross section in proton–lead collisions at sqrt(s)=5.02 TeV