Quantum nondemolition measurement of optical field fluctuations by optomechanical interaction