How to Trust Your Diffusion Model: A Convex Optimization Approach to Conformal Risk Control