Electric-dipole sum rule and two-body correlations in nuclei