The Eurozone isn't a separate entity from the European Union, but a set of economic policies. Technically all member states of the EU that have met the convergence criteria are required to adopt the Euro, with the notable exceptions of Denmark and the United Kingdom who opted out of the third stage of the Economic and Monetary Union.
According to Article 50 (3) of the Consolidated version of the Treaty on European Union, if a country withdraws from the European Union:
The Treaties shall cease to apply to the State in question from the date of entry into force of the withdrawal agreement or, failing that, two years after the notification referred to in paragraph 2, unless the European Council, in agreement with the Member State concerned, unanimously decides to extend this period.
Thus, all treaties regarding the Eurozone, starting with the 1992 Treaty of Maastricht, will no longer apply, which effectively means that a Eurozone member withdrawing from the EU will also be withdrawing from the Eurozone.
However, there is nothing stopping a country that has withdrawn from the EU to continue using the Euro as its national currency, similarly to how Monaco, San Marino, the Vatican City, Kosovo, Montenegro and Andorra have adopted the Euro without being members of the EU and without being represented in the Euro Group.