Optical detection of quasi-static actuation of nanoelectromechanical systems