Convex Optimization over Probability Measures