Ernie's answer is the correct one. But let me emphasize both the tension in what is been asked here and the answer that is given, for future readers.
The principle of relativity can be presented in the form of Galileo's ship: there is no physical experiment you could perform in an inertial reference frame that would tell you that you are moving at a particular speed or you are located in a particular place in space. You can only make relational statements, like "I'm at this distance from this other observer, or I'm moving at a relative speed of 10 m/s relative to this object". If you ignore the motion aspect of it for the moment, the principle of relativity simply tells you that there is no experiment you could ever wish to perform that would tell you your location in space. This means that absolute space is not empirically accesible and you will never get any clues about it whatever you do. So our perception of space is purely relational, relative to other things.
How could Newton believed in absolute space then if he believed in the principle of relativity? One answer could be that there is no reason why a person shouldn't hold two incompatible beliefs in his head, even if it's Newton. We do this all the time. Newtonian mechanics indeed presuposes no absolute space even if Newton personally believed in it.
But a better answer is that both beliefs are actually compatible if you consider the fact that Newton believed absolute space to be the ontology of nature (the ground truth of the universe) even if he also believed that it was empirically innacessible because this absolute space was homogeneous and the laws of physics were invariant under translations (no observer would ever come up with a good experiment to show this is true). So yeah, according to Newton absolute space exists even if it plays no role in physics and therefore it is not a testable hypothesis.
Still, it is also true that Newton played a bit with the idea of perhaps proving the existence of absolute space, and he came up with a thought experiment called the Bucket argument that would suggest there are experiments you could perform that would tell you something about the existence of absolute space. As far as I understand, if this idea was to be taken seriusly, then it would have indeed be in direct contradiction with the principle of relativity (and thus his laws of mechanics) since absolute space would be empirically accesible un thus you would have means of knowing in which inertial frame you are in absolute terms. But I might be mistaken on this. The tension generated by the Bucket argument detonated many thoughts in the XX century before the arrival of Special Relativity.