Lionel Messi has signed a new contract at Barcelona that will keep him at the Catalan giants until 2018.