If the target creature is an illegal target by the time Contract Killing resolves, the entire spell doesn't resolve. You won't get Treasures. If, on the other hand, the target is a legal target but isn't destroyed (most likely because it has indestructible), you'll get Treasures.