Centers and limit cycles of polynomial differential systems of degree 4 via averaging theory