The production of prompt charged particles in proton-lead collisions and in proton-proton collisions at the nucleon-nucleon center-of-mass energy $\sqrt{{s}_{NN}}=5\text{ }\text{ }\mathrm{TeV}$ is studied at LHCb as a function of pseudorapidity ($\ensuremath{\eta}$) and transverse momentum (${p}_{T}$) with respect to the proton beam direction. The nuclear modification factor for charged particles is determined as a function of $\ensuremath{\eta}$ between $\ensuremath{-}4.8<\ensuremath{\eta}<\ensuremath{-}2.5$ (backward region) and $2.0<\ensuremath{\eta}<4.8$ (forward region), and ${p}_{T}$ between $0.2<{p}_{T}<8.0\text{ }\text{ }\mathrm{GeV}/c$. The results show a suppression of charged particle production in proton-lead collisions relative to proton-proton collisions in the forward region and an enhancement in the backward region for ${p}_{T}$ larger than $1.5\text{ }\text{ }\mathrm{GeV}/c$. This measurement constrains nuclear PDFs and saturation models at previously unexplored values of the parton momentum fraction down to ${10}^{\ensuremath{-}6}$.