If the songs are purchased via the iTunes Store and you have no license to use them for anything but personal listening, then it's illegal. Additionally, if the song is DRM'ed and not "iTunes Plus", then you won't be able to do that at all, as only Apple products can play these files.