EU agrees deal to cap bankers' bonuses