Banks to pay $8.5 billion in foreclosure settlement