Perhaps that hallucination appears to him as a guide or a signal. In his soliloquy here he speaks to it directly at first asking if it is real or fake, and then asking it if it was leading him to do the dirty deed.
"Art thou not, fatal vision, sensible to feeling as to sight, or art thou but a dagger of the mind, a false creation...Thou marshal'st me the way that I was going; and such an instrument I was to use."
He sees the dagger as a reminder of what he must do to fulfil the prophesy. In fact, the dagger is floating in front of him with the handle facing him as if waiting for him to reach out and grab it.