State governments in Australia have backed a code drawn up by retailers that will phase out plastic bags in supermarkets by 25% per year over four years.