John Terry scored a controversial 98th-minute equaliser to earn Chelsea a point in a thriller against Everton.