That was Cordelia's spirit that was walking around and talking to everyone. Remember the body in the hospital bed, where Cordy pulled the curtain across to stop Wesley and Angel seing her? THAT was Cordelia's body.
Bascailly, The Powers that Be allowed Cordy to have one last day, to get Angel 'back on track.' Cordy said herself, The Powers that Be owed her one after everything she went through the previous year.
When Cordy tells Angel it's time for her to leave because that wasn't her world any more, it's basically her way of leaving before Angel found out the truth. But she loved him to much to leave like that, and she came back for one last kiss. When the phone rings and Cordy tells Angel he has to get that, it's the hospital calling to tell Angel that Cordelia has died. He says it's imposible, as Cordy's stand behind him, but when he turns and she's gone, he realizes it was her spirit. And then the hospital tells him that Cordelia never did wake up.
*sniffles* Ok, where'd I leave the tissues?