Javier Mascherano has ended speculation over his future by signing a new long-term deal at Barcelona.