Many of new writers ask the question:
Do I absolutely need a literary agent in order to get your book published?
The short answer is no. But if you want your book to be published by a traditional publishing house, it is much, much harder to get an editor to look at your book proposal or manuscript if you don't have an agent. For traditional publishing, you likely WANT a literary agent--and here's why having an agent is good for your book:
Agents know the right editors.
Most agents specialize in a few specific genres or interest areas of books (whether women's fiction, children's books, economic and political treatises, or cookbooks), and they know the editors who buy books in those areas.
Agents have their fingers on the pulse of trends in the book publishing marketplace.
The book marketplace changes constantly and, like all media, is affected by technology shifts, cultural shifts, and who just died in Hollywood. Agents know what a book editor wants to buy today.
A literary agent can help you shape your manuscript or proposal
...before it gets to an editor, to give it the best and most appealing spin and polish and increase your chances of getting it sold.
An agent will get you the best deal.
A literary agent has a good idea what your manuscript is worth on the ever-changing book market and will likely be able to negotiate a better book advance than you are able to negotiate yourself. Then...
Your literary agent undertakes the contract negotiation after the sale agreement.
With many ancillary subsidiary rights at stake (film, foreign, electronic, derivative, to name a few) and money attached to them all, you want someone who is knowledgeable to translate the book contract-ese for you. And see "best deal" above: the more money you make, the more money your agent makes so he or she is going to broker the best agreement possible.
Your agent will hold your hand
...through the lengthy steps to your book's publication and can explain the strange and Byzantine customs of the book publishing industry. There's still a lot of work to be done after the contract is signed--literary agents knows the drill, and have a vested interest in seeing their clients successfully through the book editing and production processes to the book's publication and marketing.