You want a version of the classical Müntz–Szász theorem for the space $L^2([0,1])$ (which is, incidentally, the case considered by Szász). Here is a nice paper on the situation for $L^p([0,1])$ spaces:
http://www.math.tamu.edu/~terdelyi/papers-online/Fullmuntz.pdf