Is it a rule in official matches, that if I touch a piece I must play with that one?
Sorry for my noobness; my friend said that I should move with the touched piece.
It's an often confusing issue. I have quoted key portions of the USCF rule book below, but the basic gist is that...
Incidentally, I once coached a scholastic, who inadvertently touched his opponent's queen (because he was too short to reach over the board easily) and his opponent claimed touch move and insisted that he capture the queen. He was only seven and not experienced enough to know to call the TD so he gave in to the older, very intimidating player and played the losing move. This was the state elementary championships, and he finished with 4 of 5 after losing this game.
New players are often unaware that accidentally touched pieces do not have to be moved. If there is doubt, call the TD. The TD should err on the side of accident and adjustment.
10A. Adjustment of pieces. A player who is on the move and first expresses the intention to adjust (e.g., by saying j'adoube or I adjust) may adjust one or more pieces on their squares.
10B. Touch-move rule. Except for 10A, a player on move who deliberately touches one or more pieces, in a manner that may reasonably be interpreted as the beginning of a move, must move or capture the first piece touched that can be moved or captured.
10E. Accidental touch of a piece. A director who believes a player touched a piece by accident should not require the player to move that piece. For example, a player's hand reaching across the board may inadvertently brush the top of a nearby king or queen, or a player may hit a piece with an elbow.