Engine recommends a move that (I think) loses a pawn [FEN "rn2kbnr/ppp1pppp/8/3q4/3P4/8/PP2PPPP/1RBQKBNR w Kkq - 0 5"]


If white doesn't play Ra1 then black can play Qxa2. But the engine says this is an inaccuracy, and that the best line is e2-e3.
In short: White can sacrifice the pawn on a2 and will gain a quicker development of his pieces. The technical term for this is compensation.

In detail: In the current position, both sides have not developed their pieces. Getting out the minor pieces and castling should have priority. 

There are no obvious weaknesses. In some lines (e.g. if white's bishop 
 is on f4 or g5 and e3 has been played) white should watch out for Bb4+. Also black has an easy way to simplify/equalize the position further by playing Nc6 followed by e5 or alternatively to attack the center with c5.

Because of this it is essential to act quickly. The white dark-squared bishop probably wants to stay on c1 or d2 for the time being because of the potential threat of Bb4+ (or even Qa5+ exchanging the queens). So the most natural development moves in the position are Nf3 or e3 (making space for the bishop on f1). Either move is decent, but e3 has the advantage that the bishop can quickly go to c4 where it attacks the queen on d5 (or a2 if black takes the pawn).

Looking at the concrete line 1. e3 Qxa2 2. Bd2, you note that white has made two development moves while black has won a pawn but the black queen is somewhat far from the action and in fact is in danger of running out of squares: white is threatening for instance Qc2, Bc4 which would win the queen).  Likely black would have to make another queen move retreating the queen to d5 or e6, losing even more time for development.