Real Madrid have confirmed that Jose Mourinho will leave at the end of the season as speculation grows about his return to Chelsea.