Optically detected nuclear magnetic resonance in semiconductor quantum wells