Bayesian inference of spreading processes on networks