FC Barcelona have announced that defender Gerard Pique has agreed a new contract with the club until 2022, with a 500 million-euro buyout clause.