Adhesion in spherical contacts and in electrostatic actuation of a carbon nanotube