Well, this is just another one of those crappily-written test questions that leaves a lot of information out. There is no mention of other runners, so I guess you have to assume there are none.
With that, the batter is awarded first base on the HBP. Since the batter successfully achieved first base safely on the play, the illegal pitch is cancelled.