Variational problem for vortices attached to seamounts