Although they both have the same meaning, the form without the apostrophe can be used to add stress to a statement, especially when spoken.
For example, "I haven't had a Covid vaccination" is simply a statement that one hasn't had the jab, whereas "I have NOT had a Covid vaccination" might be used by someone who wishes to stress that they've absolutely no intention of ever having one.
Back in my school days (over half a century ago) we were taught that the shortened forms ("haven't" and "didn't") should only be used in reported speech, with the full forms ("have not" and "did not") being used at all other times in written English. These days though, it's far more common for written English to follow spoken English, making the shorter forms fully acceptable (and, indeed, sometimes a little better, as the text then flows as freely as speech would).