From what I've heard from many, many agents at many, many conferences, an agent can't get a better contract for you on your first book than you can, so save yourself the agent's fee.
I got my agent after I received the offer, but before I signed the contract. All of my earlier books are in the school and library market, where the contracts are pretty straight forward. This was my first trade novel and the contract looked like a laundry list of clauses with clauses. My agent did not get me a bigger advance - but I wasn't looking for that either. She did get the royalties increased on a number of clauses, where I wouldn't have even thought to ask for more. She knew which rights to keep and which to let them have. She got the wording tightened considerably on a couple of clauses, one I had been concerned about and one I hadn't realized needed to be tightened until I saw her changes. I looked at the contract and saw lots and lots of words. She looked at it and knew what was set in stone, what could be changed, and what was a reasonable request. From that stand point, I got a much better contract because of her participation. This may not be true of everyone. Some writers have a better understanding of contracts and a better feel for what is and is not flexible, or they have the confidence to do it with the help of a how-to book.