Lionel Messi equalled Brazil legend Pele's record of 643 goals for a single club after scoring for Barcelona against Valencia.