Charged-particle nuclear modification factors in PbPb and pPb collisions at sqrt(s[NN]) = 5.02 TeV