Finite-temperature many-body perturbation theory for electrons