Until the end of World War I , it was closely tied to Austria , but the economic devastation caused by that conflict forced Liechtenstein to enter into a customs and monetary union with Switzerland .