New York City's mayor says a truck attack in lower Manhattan killed eight people and was a "cowardly" act of terror.