Localizations of varieties and quasivarieties