A new functional for variational calculation of atomic and molecular second-order correlation energies