in matlab easiest is using load_untouch_nii/save_untouch_nii (http://www.mathworks.com/matlabcentral/fileexchange/8797-tools-for-nifti-and-analyze-image/content/load_nii.m) and just set the extensions as you want the conversion. Same applies if you use the image calculator of spm, set the file extensions as you want the conversion to run and just put 'i1' as formula.
You could also try downloading the program MRIcron (http://www.mccauslandcenter.sc.edu/mricro/mricron/) which is useful for many things, including having a GUI to convert between file types.
Any AFNI program will convert between Nifti (nii) and Analyze (hdr/img) format. You can really use any program you want, and indicate in the "-prefix" option the format you prefer by adding an extension, ".nii" for Nifti and ".hdr" for Analyze. For example:
3dcalc -a NiftiInput.nii -expr 'a' -prefix AnalyzeOutput.hdr
3dcalc -a AnalyzeInput.hdr -expr 'a' -prefix NiftiOutput.nii