FIRST AMENDED AND RESTATED CREDIT AGREEMENT DATED AS OF JULY 30, 2004