Bayes in the sky: Bayesian inference and model selection in cosmology