Detection of nanoparticles using optical gradient forces