Pedri's goal helped Barcelona earn an agonising 1-0 win over Celta Vigo to move back top of La Liga on Sunday.