Danish leader to quit in bid to form new Cabinet despite win