Update and Note:
I’ve expanded and clarified this answer as well as adding sources, but I’ve not altered the meaning. I originally wrote this off the cuff and without sources, but it has become my most viewed answer, so I thought it deserved some additional attention. I would also like to note, that while I personally find Lolicon distateful, I support freedom of speech and protest laws against “thought crimes”.
In most places, no.
In most jurisdictions, including the United States, Japan, and most of Western Europe (with the noteable exceptions of the UK and Sweden) purely fictional sexual material in written, drawn or animated forms pertaining to underage girls (or boys) is not illegal.
Australia, Canada, New Zealand, South Africa, Sweden, and the UK have all passed laws laws that do, or at least potentialy, make even purely fictional and simulated sex acts between minors illegal. It should be noted, that most of these countries have not had these laws tested by their constitutional courts.
The United States federal government has made several attempts to ban Lolicon (and other simulated child pornography), but all have been struck down in court, however state state laws vary greatly and some state obscenity laws have been upheld in several cases: while the fact that the material depicted minors was thrown out, the obscenity of the acts depicted was upheld. These acts included abuse and beastiality. Some states, including California specifically exclude Lolicon from their child pornography laws while Utah specifically makes it illegal (although the constitutionality of that law is questionable).
Most countries that do allow Lolicon still have some level of restriction that require the material to be fantastical or non-realistic in nature. The exact nature of the restrictions vary by jurisdiction, but in general the intent is to ensure that an average person would be able to easily tell that the Lolicon is purely fictional. Another common consideration is that the pornographic material should have some artistic value.
Guide To California Child Pornography Laws | Lawfirms.com
Simpsons cartoon rip-off is child porn: judge
Translator fined over child porn cartoons
New proposals will make all obscene images of children illegal
Manga Collection Ruled “Child Pornography” By US Court