Effect of metal electrodes on optically detected magnetic resonance of nitrogen vacancy centers in diamond