Physics-informed Bayesian inference of external potentials in classical density-functional theory