Iceland's children's minister has resigned over a relationship she had with a teenager more than three decades ago.