Willian had given Chelsea the lead after twice striking the woodwork, before Messi equalised in the 75th minute with his first goal in his ninth appearance against the Blues, ending his longest goal drought against any opponent.
Barcelona controlled about three-quarters of possession in the first half but failed to put a shot on target before the break, with Paulinho missing wide from 12 yards.
Willian provided Chelsea with the better scoring opportunities and struck both posts in a span of eight minutes.
The Brazilian raced past Sergio Busquets to fire a shot from distance off the right post, then stepped up a yard closer to the top of the box and had Marc-Andre ter Stegen beaten at his near post, only to rattle to woodwork again.
But the third time was the charm for Willian, as Hazard found his teammate in space 25 yards from the goal, and the winger again rounded Busquets and curled his shot inside the post and out of the reach of Ter Stegen.
However, Barcelona will enter the second leg with a slim advantage on away goals after Messi's equaliser.
With Luis Suarez still complaining to the referees after his shouts for a penalty were ignored, Chelsea defender Andreas Christensen gave the ball away deep in his own half and Andres Iniesta ran onto the loose ball after Cesar Azpilicueta slid past.
It then took a simple cut-back pass to set up Messi to slot home a low shot from 16 yards for his first career goal against Chelsea.