Both instruments are the basis on which most modern music is based, and there's no set rule which works best for songwriting. The best answer is that it depends on your writing style and with which instrument you feel more comfortable.  Even the greatest guitar players in rock sometimes sit by the piano and come up with their best song - the same can be said for keyboardists who often pick up an acoustic and go to the most unexpected chords.