Ab-initio study of magnetic and electronic properties of the perovskites RFeO3: 4f-R valence electrons effects