Norwegian fertilizer-maker Yara posted slightly higher than expected second-quarter profits on Tuesday and warned there could be shortages of nitrogen-based fertilizers amid high gas prices.