Young stellar objects in NGC 6823