Fourth-order terms in the diagrammatic perturbation expansion for the electronic energy of atoms and molecules