In Media & Entertainment, an Agent is one who, bound by legal precedent, acts as the representative and mediator on behalf of an artist (writer, actor, director, etc.) in matters dealing with business/financial negotiations.
Legend states that the agent is a shark with dollar signs in his or her eyes. Cha-ching! For the most part, this is true and that's a good thing for you, the client. Why? Because when you make money they make money. That's why. Agents, by law, make 10% of your gross. A gross that comes from the agent procuring jobs for you and negotiating contracts. The agent wants what's best for you...and him/her.
As mentioned, the agent makes a 10% commission on your gross. No more and no less. This is state law and all "licensed" agents must abide by this measure. And it is the agent who really is the only one legally permitted to solicit work and hammer out deals. Also, the agent may not charge you an up-front fee for his/her services. You get paid, he/she gets paid. Know that these rules are sometimes broken and, as a result, frowned upon. But hey, this Hollywood not the Vatican.
It is important to note that attorneys can do what an agent does with regards to negotiating contracts, and that's great if that is all you need done, but, as stated, an agent provides much more than what an attorney can do. There are, of course, some agents who are actually attorneys. Best of both worlds. The bottom line is you want an agent who is a "go-getter" who knows the town, has everyone on speed dial, is obsessed with your work as much as his/her bling.
A couple of drawbacks regarding agents are (1) agents tend to be less intimate with their clients, which is merely a result of having so many clients. Remember, the agent is only there to sell you and your work, nothing else. They are not your shoulder to cry on and they don't babysit, unless their their client is Tom Cruise. Agents go for the gold. That's it. And (2) agents really won't look at you if you're justing breaking into world of screenwriting. You're not proven yet so why should they waste their time?