A top UK minister has resigned overnight, paving the way for a leadership challenge to PM Keir Starmer.