The UK government has warned that it could push through legislation that would force retailers to charge for plastic bags.