Least-Squares Approximation of Random Variables by Stochastic Integrals