Relativistic coupled-cluster and second-order many-body perturbation theories were used to construct two- and three-body potentials for the interaction between mercury atoms. A subsequent combined simulated-annealing downhill simplex and conjugate gradient-optimization procedure gave global minima for mercury clusters with up to 30 atoms. The calculations reveal magic cluster numbers of 6, 13, 19, 23, 26, and 29 atoms. At these cluster sizes, the static dipole polarizability obtained from density-functional theory has a minimum. The calculations also reveal a fast convergence of the polarizability towards the bulk limit in contrast to the singlet-triplet gap or the ionization potential.