Iceland's minister for children has resigned after admitting she had a child with a teenager more than 30 years ago.