Using capillary forces to determine the geometry of nanocontacts