Sayyiduna Wathilah (may Allah be pleased with him) reports this saying of the Prophet (peace and blessings be upon him): "In voluntary prayer you may count the verses, but do not count them in the obligatory prayer."
Abu Ya'la recorded it; its chain contains Abu Yahya al-Tamimi al-Kufi, who is da'if (weak).