Valencia snatched a 27th-minute lead at their Mestalla stadium when Jeremy Mathieu found space down the left wing and Jonas clipped the Frenchman's low cross high into the net past goalkeeper Jose Manuel Pinto.
Pinto was lucky to be still on the pitch after television replays showed he handled the ball outside his area in the 18th minute but the referee waved play on.
Barca captain Carles Puyol equalised 10 minutes before the break when he met a deep Cesc Fabregas corner and nodded past Diego Alves, who had come out to collect the ball but watched it sail over his head.
Alves, who has an impressive record saving spot-kicks, made amends 11 minutes into the second half when he flung himself to his left and parried away Messi's penalty, awarded after Miguel felled Thiago Alcantara in the area.
Barca substitute Daniel Alves smashed a shot against the post after a brilliant one-two with Messi around 15 minutes from time but neither side were able to find another goal ahead of next week's second leg at the Nou Camp.
"He [Messi] is a player who doesn't give you much of a clue about which way he is going to shoot," Valencia goalkeeper Alves said in a television interview.
"You just have to hang in there and try to deceive him and today I was happy to be able to help the team," the Brazilian added.
It was Barca's third successive draw, coming after they were held to a 0-0 stalemate at Villarreal in La Liga on Saturday and last week's 2-2 cup quarter-final draw at home to holders Real Madrid that sent Pep Guardiola's side through 4-3 on aggregate.
Guardiola, who was without the injured Andres Iniesta, David Villa and Pedro and opted to rest playmaker Xavi, told a news conference it was the best performance against Valencia he had seen from his players since he became coach in 2008.
"We created a lot of problems for them and they have always done the same to us, at home or away," the former Barca and Spain midfielder said.
"It was a great result but the tie is not decided and now we need to win the return leg and see if we can make the final."
The eventual winners will play 23-times cup winners Athletic Bilbao - Barca hold the record with 25 - or third-tier Mirandes in the final.
Mirandes, only the second team from Spain's Segunda B to reach the last four of the cup in its present format, gave themselves hope of pulling off another upset with a late goal in Tuesday's first leg at their tiny stadium in Miranda de Ebro as a Fernando Llorente double gave Bilbao a narrow 2-1 success.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.