Shares cut early gains to end lower as bank stocks decline