Electron correlation energy in confined two-electron systems