Shapes and stability of pendant and sessile dielectric drops in an electric field