We investigate the effects of a temperature-dependent shear viscosity over entropy density ratio eta/s on the flow anisotropy coefficients v_2 and v_4 in ultrarelativistic heavy-ion collisions at RHIC and LHC. We find that v_4 is more sensitive to the viscosity at low temperatures than v_2. At RHIC v_2 is mostly affected by the viscosity around the phase transition, but the larger the collision energy, the more the quark-gluon plasma viscosity affects v_2.