The production of prompt charged particles in proton-lead collisions and in proton-proton collisions at the nucleon-nucleon centre-of-mass energy ${\sqrt{s_{\scriptscriptstyle\mathrm{NN}}}=5\,\mathrm{TeV}}$ is studied at LHCb as a function of pseudorapidity ($\eta$) and transverse momentum ($p_{\mathrm{T}}$) with respect to the proton beam direction. The nuclear modification factor for charged particles is determined as a function of $\eta$ between ${-4.8<\eta<-2.5}$ (backward region) and ${2.0<\eta<4.8}$ (forward region), and $p_{\mathrm{T}}$ between ${0.2<p_{\mathrm{T}}<8.0\,\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_{\mathrm{T}}$ larger than $1.5\,\mathrm{GeV}/c$. This measurement constrains nuclear PDFs and saturation models at previously unexplored values of the parton momentum fraction down to $10^{-6}$.