Voldemort made the Triwizard Cup a Portkey to the cemetery, so that the first person who touched it would come to him in the graveyard. But what if somebody else got the Cup? What if Harry had died in the maze?
The contest was hardly fair. In fact, it was entirely rigged so that Harry would triumph in the maze.
Barty Crouch Jr -- posing as the eccentric ex-Auror Alastor Moody -- was patrolling around the maze and removing obstacles as well as the other contestants from Harry's path.
He Imperiussed Viktor Krum, whom he used to take out Fleur Delacour, and was on his way to take out Cedric Diggory before Harry assisted him.
Voldemort didn’t make the Cup a Portkey; fake-Moody (aka Barty Crouch, Jr) did that.
He was also one of the teachers patrolling outside the maze. He also had a magic eye that could see through more or less anything, so he could keep up with everything that was going on inside the maze.
In fact, after Harry comes back and Crouch-Moody takes him up to his office, he specifically says that he made sure Harry’s obstacles were gotten out of the way to make sure Harry won. Crouch-Moody stunned Fleur Delacour to get her out of the game, and put the Imperius Curse on Viktor Krum to make him torture Cedric Diggory, hoping thus to rid Harry of the remaining two opponents in one fell swoop. If Harry hadn’t happened to be nearby at the time, he would have succeeded, too. (I think we have to assume that Crouch-Moody was focussing on Krum and Cedric enough that he did not notice Harry being close by.)
We do not know exactly what he did to get rid of the other obstacles in the maze, but it worked—even Harry himself noticed that his way through the maze was too easy and unhindered.
Of course, Crouch-Moody (and by extension, Voldemort) could not be absolutely certain that Harry would reach the Cup first, despite his best efforts. In the end, Cedric could have touched it alone if he hadn’t been such a fair sport.
If Cedric had accepted Harry’s protests and taken the Cup, it’s hard to know what might have happened. Voldemort would definitely have been most displeased, that’s for sure. And I feel quite confident that Cedric’s fate would have been no less ill.
Because Crouch Jr. was helping Harry.
After Harry emerges from the maze, he takes Harry back to his (Moody’s) office, and explains how he nobbled the other three champions and most of Harry’s obstacles:
“You had an easier time of it than you should have in that maze tonight, of course,” said Moody. “I was patrolling around it, able to see through the outer hedges, able to curse many obstacles out of your way. I Stunned Fleur Delacour as she passed. I put the Imperius Curse on Krum, so that he would finish Diggory and leave your path to the cup clear.”
— Goblet of Fire, chapter 35 (Veritaserum)
The maze was heavily rigged in Harry’s favour.
And frankly, if Harry hadn’t reached the cup first, Voldemort would probably have killed whoever emerged and sent it back for Harry to pick up later. (And made a mental note to give Crouch Jr. a piece of his mind.)
He knew Harry’d win because part of his plan was to ensure it.
The Dark Lord had Barty Crouch Jr. stay in disguise as Moody at Hogwarts to enter Harry in the Triwizard Tournament as well as make him win. It was specifically part of the Dark Lord’s plan that Barty Crouch Jr. would have to make sure Harry was the one who got to the Triwizard Cup first.
“Use my one faithful Death Eater, stationed at Hogwarts, to ensure that the boy’s name was entered into the Goblet of Fire. Use my Death Eater to ensure that the boy won the Tournament – that he touched the Triwizard Cup first – the Cup which my Death Eater had turned into a Portkey, which would bring him here, beyond the reach of Dumbledore’s help and protection, and into my waiting arms.”
- Harry Potter and the Goblet of Fire, Chapter 33 (The Death Eaters)
Barty Crouch Jr. tells Dumbledore, while under Veritaserum, that the Dark Lord had told him his job was to guide Harry into winning the Triwizard Tournament, and set up the Portkey to take him away.
“He told me he needed to place a faithful servant at Hogwarts. A servant who would guide Harry Potter through the Triwizard Tournament without appearing to do so. A servant who would watch over Harry Potter. Ensure he reached the Triwizard Cup. Turn the Cup into a Portkey, which would take the first person to touch it to my master.”
- Harry Potter and the Goblet of Fire, Chapter 35 (Veritaserum)
Therefore, the Dark Lord expected Harry would win and get to the Cup first because he’d planned to have Barty Crouch Jr. make sure of it, which would include making sure Harry didn’t accidentally die along the way during one of the tasks before he could win and be transported to the graveyard.