No matter how bad of a book fifty shades of grey might be, from a literary point of view. You should never, ever, allow a book to be censored like that. At worst, but an age limit on it. :p
As to your question. No, I do not think it is illegal. It might if you were to describe yourself at a minor age, as then the contents would be illegal. But no where in the law is the age of an author a restriction.
On the other hand, Writing a graphic sexualized book, that works, generally requires a lot of experience. So good luck in making it enticing.