Random-matrix theory of parametric correlations in the spectra of disordered metals and chaotic billiards