On groups with periodic relative cohomology