Mohamed Salah has announced he will leave Liverpool at the end of the season after nine years with the club.