Lionel Messi has signed a new contract with Barcelona until 2021,the liga leaders confirmed, ending speculation the five-times world player of the year could leave the club he has spent his entire career for free next June.