Stability of nanobeams under nonconservative surface loading