Fed Chair Janet Yellen voiced optimism about the economy and an expectation that interest rate hikes are ahead.