Royal Bank of Scotland is consulting with unions over plans to cut up to 9,000 jobs in the next two years.