Inspired is right; it's vital to know the market you're writing for.
You say you have an idea for a YA book. Have you written it? If not, that's the next step (after or while becoming familiar with the market.) Particularly with fiction, you shouldn't query until the manuscript is complete, written, revised, rewritten, etc. Otherwise, you might find yourself with a publisher who wants to see a book that isn't ready to be sent out.
As far as agents go, they aren't as necessary for young adult fiction as for adult, but they can be helpful. Some publishers will accept submissions directly from the author, some won't. Again, before you make the decision of whether to seek an agent, you should have your book completed.
Good luck!