Czech government agrees to resign after losing confidence vote