Critical temperature of an anisotropic superconductor containing both nonmagnetic and magnetic impurities