Tractable Learning of Probability Distributions Using the Contrastive Hebbian Algorithm