We can use both. "Excerpt" is usually /only/ used to describe a part of a written text ( or, possibly, a film), while "extract" has a wider meaning and can be used to describe either a particular part of a written text or a substance in medicine, etc. (e.g: yeast extract).
"Excerpt" is probably a more suitable word to use in the situation you've described, but I would say that the word "extract" is used more commonly.