US Congress has set a timetable for withdrawal of US forces from Iraq by 2008, as part of a funding bill for the war.