Detection of weak microwave fields with an underdamped Josephson junction