  A measurement of beauty hadron production at mid-rapidity in proton-lead
collisions at a nucleon-nucleon centre-of-mass energy $\sqrt{s_{\rm NN}}=5.02$
TeV is presented. The semi-inclusive decay channel of beauty hadrons into
J/$\psi$ is considered, where the J/$\psi$ mesons are reconstructed in the
dielectron decay channel at mid-rapidity down to transverse momenta of 1.3
GeV/$c$. The ${\rm {b\overline{b}}}$ production cross section at mid-rapidity,
${\rm d}\sigma_{\rm {b\overline{b}}}/{\rm d} y$, and the total cross section
extrapolated over full phase space, $\sigma_{\rm {b\overline{b}}}$, are
obtained. This measurement is combined with results on inclusive J/$\psi$
production to determine the prompt J/$\psi$ cross sections. The results in p-Pb
collisions are then scaled to expectations from pp collisions at the same
centre-of-mass energy to derive the nuclear modification factor $R_{\rm pPb}$,
and compared to models to study possible nuclear modifications of the
production induced by cold nuclear matter effects. $R_{\rm pPb}$ is found to be
smaller than unity at low $p_{\rm T}$ for both J/$\psi$ coming from beauty
hadron decays and prompt J/$\psi$.
