Energy-Delay Optimization for Ultra-Reliable Low Latency Communication