AMENDED AND RESTATED CREDIT AGREEMENT dated as of August 5, 1997