Venezuela's legislature has approved opening the nation's oil sector to privatization.