What is the difference between a songwriter and a lyricist?

All songs consist of words and music. The words to a song are the lyrics. The music in a song is the melody. Someone who writes the words are called a lyricist. A person who writes the melody is called the composer. Both the lyricist and the composer are songwriters.