A search against news sources will show that they are used interchangeably.
However, many years ago, I remember being taught that there was a subtle difference - that the definite article was to be used where it was linked to a specific action:
Labour should commit to a 2% increase in spending in order to provide
people with the opportunity to...
While the indefinite article fitted better where the situation was more generalised:
Housing affordability is a major problem, Labour should do more to
provide people with an opportunity to buy their first home
But, I can find absolutely no evidence to support this and suspect that it was more to do with a particular teacher's preferences.
For completeness, it's worth noting that, often, the article is not required if you can use a plural:
Labour should be committed to providing opportunities for people to
change their mind.