Attorney General reaches agreement with Countrywide