pedophilia is being attracted to pre-pubescent children. "Underage" could be up to and including 17 in a lot of jurisdictions.
So, having sex with a 17 year old means you're a jerk, that you're an abuser, that you don't conform your actions to the rules of law, and a lot of other nasty/negative things, but it doesn't make you a pedophile.